<?php
class RM_Discounts_Rule_Before extends RM_Discounts_Rule {
    public function isMatched(RM_Reservation_Details $detail){
        $minDaysBeforeReservation = $this->_value;
        $startDate = clone $detail->getPeriod()->getStart();
        return ($startDate->subDay($minDaysBeforeReservation)->compare(new RM_Date()) <= 0);        
    }
}
 
